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