diff --git a/.gitattributes b/.gitattributes index 0b277fd3..08b0dbe0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -34,7 +34,3 @@ *.Mod diff=pascal *.c diff=cpp *.h diff=cpp - -# Set the language to Oberon -*.Mod linguist-language=Oberon -*.mod linguist-language=Oberon diff --git a/.gitignore b/.gitignore index 19fc1ede..22c5a97d 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,6 @@ /*.sym /*.asm /*.mod -/Errors.Txt /Errors.txt /olang /src/test/**/*.exe @@ -21,11 +20,9 @@ /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 @@ -42,5 +39,3 @@ /triage/BasicTypeSize.md /triage/Roadmap.md triage/system/* -tags -voc diff --git a/ReadMe.md b/ReadMe.md index 95d7f840..55ccd3d9 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -2,11 +2,11 @@ # Ѵishap Oberon -[Ѵishap Oberon](https://vishap.oberon.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 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, tcc or msc) to compile +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. @@ -31,11 +31,9 @@ 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: `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. + 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. These are detailed below: @@ -181,9 +179,9 @@ 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 x86_64, 32 bit arm and aarch64. +Vishap Oberon supports 32 and 64 bit little-endian architectures including Intel x86 and x64, arm and ppc. -It compiles under gcc, clang, tcc and Microsoft Visual C. +It compiles under gcc, clang and Microsoft Visual C. Installation supports GNU/Linux, MAC OSX, BSD and Windows (native and cygwin). @@ -278,13 +276,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 ](https://people.inf.ethz.ch/wirth/ProjectOberon1992.pdf) - - [Oberon - the Overlooked Jewel](http://pascal.hansotten.com/uploads/oberonpi/Oberon%20article.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](https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&doi=89e5bd3cf006bde4821599cdc57a37de5dc84bcd) + - [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](https://people.inf.ethz.ch/wirth/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 @@ -294,10 +292,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/) - - [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) + - [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/) ## History diff --git a/bootstrap/SYSTEM.c b/bootstrap/SYSTEM.c index 2952bb66..a1b2cb14 100644 --- a/bootstrap/SYSTEM.c +++ b/bootstrap/SYSTEM.c @@ -151,61 +151,53 @@ 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 - void segfaultHandler(int signal) { - __HALT(-10); - } - // Revised signal handler to accommodate additional signals like SIGSEGV + SystemSignalHandler handler[3] = {0}; + + // Provide signal handling for Unix based systems void signalHandler(int s) { - if ((s >= 2 && s <= 4) || s == 11) { // Include SIGSEGV (usually signal 11) - if (handler[s-2]) { - handler[s-2](s); - } - } - // Ignore other signals + if (s >= 2 && s <= 4) handler[s-2](s); + // (Ignore other signals) } void SystemSetHandler(int s, ADDRESS h) { - if ((s >= 2 && s <= 4) || s == 11) { + if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; - if (needtosetsystemhandler) { - signal(s, signalHandler); - } + if (needtosetsystemhandler) {signal(s, signalHandler);} } } - void setupAutomaticSegfaultHandler() { - SystemSetHandler(11, (ADDRESS)segfaultHandler); // Register handler for SIGSEGV - } - #else - // Windows system remains as is since Windows does not use SIGSEGV in the same way + + // Provides Windows callback handlers for signal-like scenarios #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 { + } else { // Close, logoff or shutdown if (SystemQuitHandler) { - SystemQuitHandler(3); // SIGQUIT + SystemQuitHandler(3); // SIGQUIT return TRUE; } } return FALSE; } + void EnsureConsoleCtrlHandler() { if (!ConsoleCtrlHandlerSet) { SetConsoleCtrlHandler(SystemConsoleCtrlHandler, TRUE); @@ -224,4 +216,3 @@ typedef void (*SystemSignalHandler)(INT32); // = Platform_SignalHandler } #endif - diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index 39d594ed..07c6fd10 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -116,11 +116,9 @@ extern void Modules_AssertFail(INT32 x); // Index checking -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)) +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 @@ -267,12 +265,7 @@ extern void Heap_INCREF(); 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 4460479d..bd643b9a 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index fa87c9de..1c746b94 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 [2025/06/24]. 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 c3c54eed..1747f3ca 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 54341368..821546e2 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -86,7 +86,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); 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,11 +634,6 @@ 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 ccdabcc2..8ba31015 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -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); 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 42552415..c7957869 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 3cde1c3b..385cd08c 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 535721e8..f1df9980 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 26d86b38..74575f7f 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 913fbf2d..46fc80da 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -1626,7 +1626,6 @@ 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 f66fcd66..d409cbfd 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 7b92ccc1..dfeb1a84 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -618,33 +618,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))) { - 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); + 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); OPM_Write(')'); - OPM_WriteLn(); + } 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(')'); + OPM_WriteLn(); } OPC_DefineTProcMacros(obj->right, &*empty); } @@ -654,7 +652,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) || (((OPM_currFile == 0 && str->strobj != NIL)) && str->strobj->vis == 1)) { + if (OPM_currFile == 1 || str->ref < 255) { obj = str->strobj; if (obj == NIL || OPC_Undefined(obj)) { if (obj != NIL) { @@ -721,13 +719,6 @@ 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 3bfd88b8..4086dae5 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 bcb39247..9c87c0c5 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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,8 +19,6 @@ 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]; @@ -61,7 +59,6 @@ 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); @@ -85,7 +82,6 @@ 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); @@ -161,36 +157,6 @@ 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; @@ -797,7 +763,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 != 0x84) { + if (tag != 0xf7 || ver != 0x83) { if (!__IN(4, OPM_Options, 32)) { OPM_err(-306); } @@ -868,7 +834,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, 0x84); + Files_Write(&OPM_newSF, Files_Rider__typ, 0x83); } else { OPM_err(153); } @@ -1177,7 +1143,5 @@ 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 64c15a28..8b0c7133 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -30,7 +30,6 @@ 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); @@ -49,7 +48,6 @@ 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 ad4a370a..4226dd8b 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 3d8cefe8..a389b3d9 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 a25a2c12..4dd60bee 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -279,74 +279,32 @@ 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); - 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) { + for (;;) { + for (;;) { + while (OPS_ch == '(') { OPM_Get(&OPS_ch); - } else { - prevCh = 0x00; - } - } else { - if ((((isExported && nestLevel == 1)) && prevCh != 0x00)) { - if (i < 255) { - commentText[__X(i, 256)] = prevCh; - i += 1; + if (OPS_ch == '*') { + Comment__2(); } } - prevCh = OPS_ch; - } - if (nestLevel > 0) { + if (OPS_ch == '*') { + OPM_Get(&OPS_ch); + break; + } + if (OPS_ch == 0x00) { + break; + } OPM_Get(&OPS_ch); } - } - 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 == ')') { + OPM_Get(&OPS_ch); + break; } - } - if (isExported) { - if (i >= 256) { - OPM_LogWStr((CHAR*)"Warning: commentText overflow", 30); - OPM_LogWLn(); - i = 255; + if (OPS_ch == 0x00) { + OPS_err(5); + break; } - commentText[__X(i, 256)] = 0x00; - OPM_StoreComment(commentText, 256); } } diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 19e222ac..009b0baa 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 72261b24..9284c006 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -83,7 +83,6 @@ typedef OPT_Const conval; INT32 adr, linkadr; INT16 x; - OPT_ConstExt comment; } OPT_ObjDesc; typedef @@ -174,7 +173,6 @@ 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); @@ -390,10 +388,6 @@ 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; } @@ -560,8 +554,6 @@ 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; @@ -593,16 +585,6 @@ 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; } } @@ -1121,13 +1103,6 @@ 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) { @@ -1406,37 +1381,7 @@ 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; @@ -1452,7 +1397,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 && tag <= 33)) { + } else if (tag >= 31) { obj->conval = OPT_NewConst(); obj->conval->intval = -1; OPT_InSign(mno, &obj->typ, &obj->link); @@ -1479,37 +1424,20 @@ 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 if (tag == 21 || tag == 22) { + } else { 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); @@ -1852,40 +1780,13 @@ 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) { @@ -2125,7 +2026,7 @@ static void EnumPtrs(void (*P)(void*)) } __TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 32), {0, -8}}; -__TDESC(OPT_ObjDesc, 1, 7) = {__TDFLDS("ObjDesc", 308), {0, 4, 8, 12, 284, 288, 304, -32}}; +__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, diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index cf456af5..95bbf8b0 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -61,7 +61,6 @@ 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 0425b2e0..3e6f92d5 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 fbabd8f4..ca2ef73d 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 ce936589..6f5e342a 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 a72547f4..7507a692 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 befa6033..db6a8378 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 fbeef8c7..7ef51226 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 512ec2c4..c969b821 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 93e7fa75..b1b5513e 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 4b18812f..c0b1581b 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 f0e3ae34..e5750cb0 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 7e7522c2..c2e600fa 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -8,6 +8,7 @@ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" +#include "Out.h" #include "Reals.h" typedef @@ -1809,6 +1810,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 dc569fa9..ea14161b 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 346fb37b..aad9af3b 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -34,7 +34,6 @@ 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); @@ -137,15 +136,6 @@ 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); @@ -266,7 +256,6 @@ 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 4e708647..a382735c 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -25,7 +25,6 @@ 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 ce2fc413..9ffffdd9 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -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, CHAR *additionalopts, ADDRESS additionalopts__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); @@ -70,26 +70,22 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES __DEL(cmd); } -static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len, CHAR *additionalopts, ADDRESS additionalopts__len) +static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __DUP(additionalopts, additionalopts__len, CHAR); - __COPY("gcc -fPIC -g -Wno-stringop-overflow", 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); - 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, (CHAR*)"", 1); + 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); @@ -101,9 +97,10 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati { extTools_CommandString cmd; __DUP(additionalopts, additionalopts__len, CHAR); - extTools_InitialiseCompilerCommand((void*)cmd, 4096, additionalopts, additionalopts__len); + 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, 4096); } diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 686f0b4e..403cdeff 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 4460479d..bd643b9a 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index fa87c9de..1c746b94 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 [2025/06/24]. 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 c3c54eed..1747f3ca 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 54341368..821546e2 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -86,7 +86,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); 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,11 +634,6 @@ 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 ccdabcc2..8ba31015 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -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); 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 42552415..c7957869 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 3cde1c3b..385cd08c 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 535721e8..f1df9980 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 26d86b38..74575f7f 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 913fbf2d..46fc80da 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -1626,7 +1626,6 @@ 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 f66fcd66..d409cbfd 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 7b92ccc1..dfeb1a84 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -618,33 +618,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))) { - 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); + 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); OPM_Write(')'); - OPM_WriteLn(); + } 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(')'); + OPM_WriteLn(); } OPC_DefineTProcMacros(obj->right, &*empty); } @@ -654,7 +652,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) || (((OPM_currFile == 0 && str->strobj != NIL)) && str->strobj->vis == 1)) { + if (OPM_currFile == 1 || str->ref < 255) { obj = str->strobj; if (obj == NIL || OPC_Undefined(obj)) { if (obj != NIL) { @@ -721,13 +719,6 @@ 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 3bfd88b8..4086dae5 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 bcb39247..9c87c0c5 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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,8 +19,6 @@ 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]; @@ -61,7 +59,6 @@ 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); @@ -85,7 +82,6 @@ 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); @@ -161,36 +157,6 @@ 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; @@ -797,7 +763,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 != 0x84) { + if (tag != 0xf7 || ver != 0x83) { if (!__IN(4, OPM_Options, 32)) { OPM_err(-306); } @@ -868,7 +834,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, 0x84); + Files_Write(&OPM_newSF, Files_Rider__typ, 0x83); } else { OPM_err(153); } @@ -1177,7 +1143,5 @@ 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 64c15a28..8b0c7133 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -30,7 +30,6 @@ 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); @@ -49,7 +48,6 @@ 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 ad4a370a..4226dd8b 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 3d8cefe8..a389b3d9 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 a25a2c12..4dd60bee 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -279,74 +279,32 @@ 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); - 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) { + for (;;) { + for (;;) { + while (OPS_ch == '(') { OPM_Get(&OPS_ch); - } else { - prevCh = 0x00; - } - } else { - if ((((isExported && nestLevel == 1)) && prevCh != 0x00)) { - if (i < 255) { - commentText[__X(i, 256)] = prevCh; - i += 1; + if (OPS_ch == '*') { + Comment__2(); } } - prevCh = OPS_ch; - } - if (nestLevel > 0) { + if (OPS_ch == '*') { + OPM_Get(&OPS_ch); + break; + } + if (OPS_ch == 0x00) { + break; + } OPM_Get(&OPS_ch); } - } - 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 == ')') { + OPM_Get(&OPS_ch); + break; } - } - if (isExported) { - if (i >= 256) { - OPM_LogWStr((CHAR*)"Warning: commentText overflow", 30); - OPM_LogWLn(); - i = 255; + if (OPS_ch == 0x00) { + OPS_err(5); + break; } - commentText[__X(i, 256)] = 0x00; - OPM_StoreComment(commentText, 256); } } diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 19e222ac..009b0baa 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 ebb47dd8..50f3065b 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -83,7 +83,6 @@ typedef OPT_Const conval; INT32 adr, linkadr; INT16 x; - OPT_ConstExt comment; } OPT_ObjDesc; typedef @@ -174,7 +173,6 @@ 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); @@ -390,10 +388,6 @@ 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; } @@ -560,8 +554,6 @@ 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; @@ -593,16 +585,6 @@ 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; } } @@ -1121,13 +1103,6 @@ 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) { @@ -1406,37 +1381,7 @@ 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; @@ -1452,7 +1397,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 && tag <= 33)) { + } else if (tag >= 31) { obj->conval = OPT_NewConst(); obj->conval->intval = -1; OPT_InSign(mno, &obj->typ, &obj->link); @@ -1479,37 +1424,20 @@ 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 if (tag == 21 || tag == 22) { + } else { 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); @@ -1852,40 +1780,13 @@ 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) { @@ -2125,7 +2026,7 @@ static void EnumPtrs(void (*P)(void*)) } __TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -8}}; -__TDESC(OPT_ObjDesc, 1, 7) = {__TDFLDS("ObjDesc", 308), {0, 4, 8, 12, 284, 288, 304, -32}}; +__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, diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index cf456af5..95bbf8b0 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -61,7 +61,6 @@ 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 0425b2e0..3e6f92d5 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 fbabd8f4..ca2ef73d 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 ce936589..6f5e342a 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 a72547f4..7507a692 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 befa6033..db6a8378 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 fbeef8c7..7ef51226 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 512ec2c4..c969b821 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 93e7fa75..b1b5513e 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 4b18812f..c0b1581b 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 f0e3ae34..e5750cb0 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 43c3858f..fcd01a50 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -8,6 +8,7 @@ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" +#include "Out.h" #include "Reals.h" typedef @@ -1809,6 +1810,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 fd0c0fa5..443cb429 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 346fb37b..aad9af3b 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -34,7 +34,6 @@ 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); @@ -137,15 +136,6 @@ 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); @@ -266,7 +256,6 @@ 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 4e708647..a382735c 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -25,7 +25,6 @@ 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 ce2fc413..9ffffdd9 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -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, CHAR *additionalopts, ADDRESS additionalopts__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); @@ -70,26 +70,22 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES __DEL(cmd); } -static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len, CHAR *additionalopts, ADDRESS additionalopts__len) +static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __DUP(additionalopts, additionalopts__len, CHAR); - __COPY("gcc -fPIC -g -Wno-stringop-overflow", 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); - 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, (CHAR*)"", 1); + 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); @@ -101,9 +97,10 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati { extTools_CommandString cmd; __DUP(additionalopts, additionalopts__len, CHAR); - extTools_InitialiseCompilerCommand((void*)cmd, 4096, additionalopts, additionalopts__len); + 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, 4096); } diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 686f0b4e..403cdeff 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 4460479d..bd643b9a 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index fa87c9de..1c746b94 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 [2025/06/24]. 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 c3c54eed..1747f3ca 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 57e78310..9a887e8f 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -86,7 +86,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); 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,11 +634,6 @@ 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 676f434c..23f65c21 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -41,7 +41,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); 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 7b004b60..5b01f160 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 45a9c6d2..82b83e8c 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 a5b989e5..5f8012d2 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 ee65a938..2d245d3b 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 913fbf2d..46fc80da 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -1626,7 +1626,6 @@ 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 f66fcd66..d409cbfd 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 7b92ccc1..dfeb1a84 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -618,33 +618,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))) { - 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); + 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); OPM_Write(')'); - OPM_WriteLn(); + } 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(')'); + OPM_WriteLn(); } OPC_DefineTProcMacros(obj->right, &*empty); } @@ -654,7 +652,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) || (((OPM_currFile == 0 && str->strobj != NIL)) && str->strobj->vis == 1)) { + if (OPM_currFile == 1 || str->ref < 255) { obj = str->strobj; if (obj == NIL || OPC_Undefined(obj)) { if (obj != NIL) { @@ -721,13 +719,6 @@ 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 3bfd88b8..4086dae5 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 b486b3b9..716c199c 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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,8 +19,6 @@ 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]; @@ -61,7 +59,6 @@ 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); @@ -85,7 +82,6 @@ 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); @@ -161,36 +157,6 @@ 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; @@ -797,7 +763,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 != 0x84) { + if (tag != 0xf7 || ver != 0x83) { if (!__IN(4, OPM_Options, 32)) { OPM_err(-306); } @@ -868,7 +834,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, 0x84); + Files_Write(&OPM_newSF, Files_Rider__typ, 0x83); } else { OPM_err(153); } @@ -1177,7 +1143,5 @@ 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 64c15a28..8b0c7133 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -30,7 +30,6 @@ 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); @@ -49,7 +48,6 @@ 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 3fed2e31..5726dee1 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 3d8cefe8..a389b3d9 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 a25a2c12..4dd60bee 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -279,74 +279,32 @@ 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); - 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) { + for (;;) { + for (;;) { + while (OPS_ch == '(') { OPM_Get(&OPS_ch); - } else { - prevCh = 0x00; - } - } else { - if ((((isExported && nestLevel == 1)) && prevCh != 0x00)) { - if (i < 255) { - commentText[__X(i, 256)] = prevCh; - i += 1; + if (OPS_ch == '*') { + Comment__2(); } } - prevCh = OPS_ch; - } - if (nestLevel > 0) { + if (OPS_ch == '*') { + OPM_Get(&OPS_ch); + break; + } + if (OPS_ch == 0x00) { + break; + } OPM_Get(&OPS_ch); } - } - 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 == ')') { + OPM_Get(&OPS_ch); + break; } - } - if (isExported) { - if (i >= 256) { - OPM_LogWStr((CHAR*)"Warning: commentText overflow", 30); - OPM_LogWLn(); - i = 255; + if (OPS_ch == 0x00) { + OPS_err(5); + break; } - commentText[__X(i, 256)] = 0x00; - OPM_StoreComment(commentText, 256); } } diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 19e222ac..009b0baa 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 c3999981..cf98d97c 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -83,7 +83,6 @@ typedef OPT_Const conval; INT32 adr, linkadr; INT16 x; - OPT_ConstExt comment; } OPT_ObjDesc; typedef @@ -174,7 +173,6 @@ 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); @@ -390,10 +388,6 @@ 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; } @@ -560,8 +554,6 @@ 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; @@ -593,16 +585,6 @@ 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; } } @@ -1121,13 +1103,6 @@ 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) { @@ -1406,37 +1381,7 @@ 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; @@ -1452,7 +1397,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 && tag <= 33)) { + } else if (tag >= 31) { obj->conval = OPT_NewConst(); obj->conval->intval = -1; OPT_InSign(mno, &obj->typ, &obj->link); @@ -1479,37 +1424,20 @@ 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 if (tag == 21 || tag == 22) { + } else { 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); @@ -1852,40 +1780,13 @@ 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) { @@ -2125,7 +2026,7 @@ static void EnumPtrs(void (*P)(void*)) } __TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -16}}; -__TDESC(OPT_ObjDesc, 1, 7) = {__TDFLDS("ObjDesc", 344), {0, 8, 16, 24, 304, 312, 336, -64}}; +__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", 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 cf456af5..95bbf8b0 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -61,7 +61,6 @@ 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 26c1c715..14f83a4d 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 fbabd8f4..ca2ef73d 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 ce936589..6f5e342a 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 a72547f4..7507a692 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 139181a0..c56505b5 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 e827b641..53e6dedf 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 512ec2c4..c969b821 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 93e7fa75..b1b5513e 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 4b18812f..c0b1581b 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 f0e3ae34..e5750cb0 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 77dc1bac..fb6f4a4c 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -8,6 +8,7 @@ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" +#include "Out.h" #include "Reals.h" typedef @@ -1809,6 +1810,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 081eec2c..64bd272c 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 346fb37b..aad9af3b 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -34,7 +34,6 @@ 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); @@ -137,15 +136,6 @@ 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); @@ -266,7 +256,6 @@ 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 4e708647..a382735c 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -25,7 +25,6 @@ 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 ce2fc413..9ffffdd9 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -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, CHAR *additionalopts, ADDRESS additionalopts__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); @@ -70,26 +70,22 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES __DEL(cmd); } -static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len, CHAR *additionalopts, ADDRESS additionalopts__len) +static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __DUP(additionalopts, additionalopts__len, CHAR); - __COPY("gcc -fPIC -g -Wno-stringop-overflow", 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); - 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, (CHAR*)"", 1); + 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); @@ -101,9 +97,10 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati { extTools_CommandString cmd; __DUP(additionalopts, additionalopts__len, CHAR); - extTools_InitialiseCompilerCommand((void*)cmd, 4096, additionalopts, additionalopts__len); + 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, 4096); } diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 686f0b4e..403cdeff 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 4460479d..bd643b9a 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index fa87c9de..1c746b94 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 [2025/06/24]. 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 c3c54eed..1747f3ca 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 553bb49a..7d838e6c 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -86,7 +86,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); 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,11 +634,6 @@ 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 dadf1ace..b539610b 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -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); 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 42552415..c7957869 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 3cde1c3b..385cd08c 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 bdad4713..c4f50e79 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 26d86b38..74575f7f 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 913fbf2d..46fc80da 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -1626,7 +1626,6 @@ 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 f66fcd66..d409cbfd 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 7b92ccc1..dfeb1a84 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -618,33 +618,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))) { - 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); + 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); OPM_Write(')'); - OPM_WriteLn(); + } 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(')'); + OPM_WriteLn(); } OPC_DefineTProcMacros(obj->right, &*empty); } @@ -654,7 +652,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) || (((OPM_currFile == 0 && str->strobj != NIL)) && str->strobj->vis == 1)) { + if (OPM_currFile == 1 || str->ref < 255) { obj = str->strobj; if (obj == NIL || OPC_Undefined(obj)) { if (obj != NIL) { @@ -721,13 +719,6 @@ 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 3bfd88b8..4086dae5 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 bcb39247..9c87c0c5 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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,8 +19,6 @@ 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]; @@ -61,7 +59,6 @@ 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); @@ -85,7 +82,6 @@ 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); @@ -161,36 +157,6 @@ 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; @@ -797,7 +763,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 != 0x84) { + if (tag != 0xf7 || ver != 0x83) { if (!__IN(4, OPM_Options, 32)) { OPM_err(-306); } @@ -868,7 +834,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, 0x84); + Files_Write(&OPM_newSF, Files_Rider__typ, 0x83); } else { OPM_err(153); } @@ -1177,7 +1143,5 @@ 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 64c15a28..8b0c7133 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -30,7 +30,6 @@ 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); @@ -49,7 +48,6 @@ 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 ad4a370a..4226dd8b 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 3d8cefe8..a389b3d9 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 a25a2c12..4dd60bee 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -279,74 +279,32 @@ 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); - 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) { + for (;;) { + for (;;) { + while (OPS_ch == '(') { OPM_Get(&OPS_ch); - } else { - prevCh = 0x00; - } - } else { - if ((((isExported && nestLevel == 1)) && prevCh != 0x00)) { - if (i < 255) { - commentText[__X(i, 256)] = prevCh; - i += 1; + if (OPS_ch == '*') { + Comment__2(); } } - prevCh = OPS_ch; - } - if (nestLevel > 0) { + if (OPS_ch == '*') { + OPM_Get(&OPS_ch); + break; + } + if (OPS_ch == 0x00) { + break; + } OPM_Get(&OPS_ch); } - } - 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 == ')') { + OPM_Get(&OPS_ch); + break; } - } - if (isExported) { - if (i >= 256) { - OPM_LogWStr((CHAR*)"Warning: commentText overflow", 30); - OPM_LogWLn(); - i = 255; + if (OPS_ch == 0x00) { + OPS_err(5); + break; } - commentText[__X(i, 256)] = 0x00; - OPM_StoreComment(commentText, 256); } } diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 19e222ac..009b0baa 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 ebb47dd8..50f3065b 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -83,7 +83,6 @@ typedef OPT_Const conval; INT32 adr, linkadr; INT16 x; - OPT_ConstExt comment; } OPT_ObjDesc; typedef @@ -174,7 +173,6 @@ 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); @@ -390,10 +388,6 @@ 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; } @@ -560,8 +554,6 @@ 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; @@ -593,16 +585,6 @@ 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; } } @@ -1121,13 +1103,6 @@ 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) { @@ -1406,37 +1381,7 @@ 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; @@ -1452,7 +1397,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 && tag <= 33)) { + } else if (tag >= 31) { obj->conval = OPT_NewConst(); obj->conval->intval = -1; OPT_InSign(mno, &obj->typ, &obj->link); @@ -1479,37 +1424,20 @@ 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 if (tag == 21 || tag == 22) { + } else { 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); @@ -1852,40 +1780,13 @@ 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) { @@ -2125,7 +2026,7 @@ static void EnumPtrs(void (*P)(void*)) } __TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -8}}; -__TDESC(OPT_ObjDesc, 1, 7) = {__TDFLDS("ObjDesc", 308), {0, 4, 8, 12, 284, 288, 304, -32}}; +__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, diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index cf456af5..95bbf8b0 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -61,7 +61,6 @@ 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 0425b2e0..3e6f92d5 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 fbabd8f4..ca2ef73d 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 b43e55f1..c0b2adae 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 a72547f4..7507a692 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 9b1f0e4f..bc0d563b 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 b1ed4c6f..49c44602 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 512ec2c4..c969b821 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 93e7fa75..b1b5513e 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 4b18812f..c0b1581b 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 f0e3ae34..e5750cb0 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 43c3858f..fcd01a50 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -8,6 +8,7 @@ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" +#include "Out.h" #include "Reals.h" typedef @@ -1809,6 +1810,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 fd0c0fa5..443cb429 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 346fb37b..aad9af3b 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -34,7 +34,6 @@ 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); @@ -137,15 +136,6 @@ 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); @@ -266,7 +256,6 @@ 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 4e708647..a382735c 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -25,7 +25,6 @@ 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 ce2fc413..9ffffdd9 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -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, CHAR *additionalopts, ADDRESS additionalopts__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); @@ -70,26 +70,22 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES __DEL(cmd); } -static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len, CHAR *additionalopts, ADDRESS additionalopts__len) +static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __DUP(additionalopts, additionalopts__len, CHAR); - __COPY("gcc -fPIC -g -Wno-stringop-overflow", 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); - 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, (CHAR*)"", 1); + 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); @@ -101,9 +97,10 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati { extTools_CommandString cmd; __DUP(additionalopts, additionalopts__len, CHAR); - extTools_InitialiseCompilerCommand((void*)cmd, 4096, additionalopts, additionalopts__len); + 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, 4096); } diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 686f0b4e..403cdeff 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 4460479d..bd643b9a 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index fa87c9de..1c746b94 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 [2025/06/24]. 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 c3c54eed..1747f3ca 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 07655515..180b7cae 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -87,7 +87,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); 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); @@ -636,11 +635,6 @@ 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 8a7e59f8..70e6cb03 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -41,7 +41,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); 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 7b004b60..5b01f160 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 45a9c6d2..82b83e8c 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 7a49b8ff..8daa2dfd 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 ee65a938..2d245d3b 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 913fbf2d..46fc80da 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -1626,7 +1626,6 @@ 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 f66fcd66..d409cbfd 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 7b92ccc1..dfeb1a84 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -618,33 +618,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))) { - 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); + 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); OPM_Write(')'); - OPM_WriteLn(); + } 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(')'); + OPM_WriteLn(); } OPC_DefineTProcMacros(obj->right, &*empty); } @@ -654,7 +652,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) || (((OPM_currFile == 0 && str->strobj != NIL)) && str->strobj->vis == 1)) { + if (OPM_currFile == 1 || str->ref < 255) { obj = str->strobj; if (obj == NIL || OPC_Undefined(obj)) { if (obj != NIL) { @@ -721,13 +719,6 @@ 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 3bfd88b8..4086dae5 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 b486b3b9..716c199c 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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,8 +19,6 @@ 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]; @@ -61,7 +59,6 @@ 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); @@ -85,7 +82,6 @@ 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); @@ -161,36 +157,6 @@ 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; @@ -797,7 +763,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 != 0x84) { + if (tag != 0xf7 || ver != 0x83) { if (!__IN(4, OPM_Options, 32)) { OPM_err(-306); } @@ -868,7 +834,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, 0x84); + Files_Write(&OPM_newSF, Files_Rider__typ, 0x83); } else { OPM_err(153); } @@ -1177,7 +1143,5 @@ 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 64c15a28..8b0c7133 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -30,7 +30,6 @@ 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); @@ -49,7 +48,6 @@ 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 3fed2e31..5726dee1 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 3d8cefe8..a389b3d9 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 a25a2c12..4dd60bee 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -279,74 +279,32 @@ 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); - 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) { + for (;;) { + for (;;) { + while (OPS_ch == '(') { OPM_Get(&OPS_ch); - } else { - prevCh = 0x00; - } - } else { - if ((((isExported && nestLevel == 1)) && prevCh != 0x00)) { - if (i < 255) { - commentText[__X(i, 256)] = prevCh; - i += 1; + if (OPS_ch == '*') { + Comment__2(); } } - prevCh = OPS_ch; - } - if (nestLevel > 0) { + if (OPS_ch == '*') { + OPM_Get(&OPS_ch); + break; + } + if (OPS_ch == 0x00) { + break; + } OPM_Get(&OPS_ch); } - } - 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 == ')') { + OPM_Get(&OPS_ch); + break; } - } - if (isExported) { - if (i >= 256) { - OPM_LogWStr((CHAR*)"Warning: commentText overflow", 30); - OPM_LogWLn(); - i = 255; + if (OPS_ch == 0x00) { + OPS_err(5); + break; } - commentText[__X(i, 256)] = 0x00; - OPM_StoreComment(commentText, 256); } } diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 19e222ac..009b0baa 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 c3999981..cf98d97c 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -83,7 +83,6 @@ typedef OPT_Const conval; INT32 adr, linkadr; INT16 x; - OPT_ConstExt comment; } OPT_ObjDesc; typedef @@ -174,7 +173,6 @@ 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); @@ -390,10 +388,6 @@ 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; } @@ -560,8 +554,6 @@ 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; @@ -593,16 +585,6 @@ 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; } } @@ -1121,13 +1103,6 @@ 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) { @@ -1406,37 +1381,7 @@ 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; @@ -1452,7 +1397,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 && tag <= 33)) { + } else if (tag >= 31) { obj->conval = OPT_NewConst(); obj->conval->intval = -1; OPT_InSign(mno, &obj->typ, &obj->link); @@ -1479,37 +1424,20 @@ 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 if (tag == 21 || tag == 22) { + } else { 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); @@ -1852,40 +1780,13 @@ 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) { @@ -2125,7 +2026,7 @@ static void EnumPtrs(void (*P)(void*)) } __TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -16}}; -__TDESC(OPT_ObjDesc, 1, 7) = {__TDFLDS("ObjDesc", 344), {0, 8, 16, 24, 304, 312, 336, -64}}; +__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", 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 cf456af5..95bbf8b0 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -61,7 +61,6 @@ 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 26c1c715..14f83a4d 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 fbabd8f4..ca2ef73d 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 b43e55f1..c0b2adae 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 a72547f4..7507a692 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 563f6417..27c077b9 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 1259a228..1dc659c2 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 512ec2c4..c969b821 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 93e7fa75..b1b5513e 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 4b18812f..c0b1581b 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 f0e3ae34..e5750cb0 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 77dc1bac..fb6f4a4c 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -8,6 +8,7 @@ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" +#include "Out.h" #include "Reals.h" typedef @@ -1809,6 +1810,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 081eec2c..64bd272c 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 346fb37b..aad9af3b 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -34,7 +34,6 @@ 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); @@ -137,15 +136,6 @@ 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); @@ -266,7 +256,6 @@ 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 4e708647..a382735c 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -25,7 +25,6 @@ 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 ce2fc413..9ffffdd9 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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 @@ -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, CHAR *additionalopts, ADDRESS additionalopts__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); @@ -70,26 +70,22 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES __DEL(cmd); } -static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len, CHAR *additionalopts, ADDRESS additionalopts__len) +static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __DUP(additionalopts, additionalopts__len, CHAR); - __COPY("gcc -fPIC -g -Wno-stringop-overflow", 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); - 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, (CHAR*)"", 1); + 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); @@ -101,9 +97,10 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati { extTools_CommandString cmd; __DUP(additionalopts, additionalopts__len, CHAR); - extTools_InitialiseCompilerCommand((void*)cmd, 4096, additionalopts, additionalopts__len); + 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, 4096); } diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 686f0b4e..403cdeff 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2025/06/24]. 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/doc/ctags.md b/doc/ctags.md deleted file mode 100644 index d6e8a40d..00000000 --- a/doc/ctags.md +++ /dev/null @@ -1,82 +0,0 @@ -## Code navigation with ctags - -[`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). - -## 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 handling 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, 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/makefile b/makefile index 08b69845..8186e175 100644 --- a/makefile +++ b/makefile @@ -19,7 +19,6 @@ # # clang # gcc -# tcc # i686-w64-mingw32-gcc (32 bit cygwin only) # x86_64-w64-mingw32-gcc (64 bit cygwin only) # @@ -82,8 +81,6 @@ 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 "" @@ -91,11 +88,8 @@ usage: @echo " make bootstrap - Update bootstrap C source directories." @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 + + # Generate config files Configuration.Make and Configuration.Mod FORCE: diff --git a/oberon.ctags b/oberon.ctags deleted file mode 100644 index f0ef512f..00000000 --- a/oberon.ctags +++ /dev/null @@ -1,14 +0,0 @@ -# universal tags -# 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*PROCEDURE\s*(\^|-)?\s*([a-zA-Z][a-zA-Z0-9]*)/\2/p/{scope=ref} - diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 3ff7fffc..718d9b9e 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -893,25 +893,6 @@ 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 diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 80e6bd66..d1f9027a 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -409,24 +409,22 @@ 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)) 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 + 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 END ; DefineTProcMacros(obj^.right, empty) END @@ -435,7 +433,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*) ) OR ((OPM.currFile = OPM.HeaderFile) & (str^.strobj # NIL) & (str^.strobj^.vis = OPT.external)) THEN + 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 *) @@ -457,7 +455,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 ; @@ -477,11 +475,6 @@ 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 diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index ab3d7dae..b64e1e94 100755 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -8,7 +8,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) CONST OptionChar* = "-"; - MaxCommentLen* = 1024; (* compiler option flag bits; don't change the encoding *) inxchk* = 0; (* index check on *) @@ -77,16 +76,15 @@ 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 = 084X; (* symbol file version. Increment if symbol file format is changed. *) + SFver = 083X; (* 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 *) @@ -152,33 +150,6 @@ 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 *) @@ -859,7 +830,4 @@ 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 f81bcae6..9cb59e37 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* = 1024; + MaxStrLen* = 256; MaxIdLen = 256; @@ -190,99 +190,22 @@ 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; - VAR - isExported: BOOLEAN; - commentText: ARRAY OPM.MaxCommentLen OF CHAR; - i: INTEGER; - nestLevel: INTEGER; - prevCh: 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 := ch; (* Don't set to 0X - keep the '*' *) + 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) - ELSIF (prevCh = "*") & (ch = ")") THEN - DEC(nestLevel); - IF nestLevel = 0 THEN - OPM.Get(ch); (* move past ')' *) - ELSE - prevCh := ch; (* Keep the ')' *) - OPM.Get(ch) - END - ELSE - IF isExported & (nestLevel = 1) THEN - IF i < OPM.MaxCommentLen - 1 THEN - (* 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 - ELSE - prevCh := ch; OPM.Get(ch) - END - END - END; - - IF ch = OPM.Eot THEN - err(5) - 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 ; + IF ch = ")" THEN OPM.Get(ch); EXIT END ; + IF ch = OPM.Eot THEN err(5); EXIT END + 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 228a8226..758bb505 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -46,8 +46,7 @@ TYPE typ*: Struct; conval*: Const; adr*, linkadr*: LONGINT; - x*: INTEGER; (* linkadr and x can be freely used by the backend *) - comment*: ConstExt; + x*: INTEGER (* linkadr and x can be freely used by the backend *) END; CONST @@ -179,7 +178,6 @@ 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 @@ -369,15 +367,7 @@ END NewConst; PROCEDURE NewObj*(): Object; VAR obj: Object; -BEGIN - NEW(obj); - (* lets fully init pointers *) - obj^.typ := NIL; - obj^.conval := NIL; - obj^.comment := NIL; - obj^.name := ""; - - RETURN obj +BEGIN NEW(obj); RETURN obj END NewObj; PROCEDURE NewStr*(form, comp: SHORTINT): Struct; @@ -478,16 +468,8 @@ BEGIN END FindField; PROCEDURE Insert*(VAR name: OPS.Name; VAR obj: Object); -VAR - ob0, ob1: Object; - left: BOOLEAN; - mnolev: SHORTINT; - commentText: ARRAY OPM.MaxCommentLen OF CHAR; - j: INTEGER; -BEGIN - ob0 := topScope; - ob1 := ob0^.right; - left := FALSE; + 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 @@ -498,24 +480,13 @@ BEGIN 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. *) @@ -811,7 +782,6 @@ 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; @@ -821,25 +791,13 @@ 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 - - (* 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; + 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; @@ -1015,52 +973,11 @@ 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: ARRAY OPM.MaxCommentLen OF CHAR; - 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;*) - - (* 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 - 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 *) @@ -1069,7 +986,7 @@ BEGIN IF tag <= Pointer THEN (* Constant *) obj^.mode := Con; obj^.conval := NewConst(); InConstant(tag, obj^.conval); obj^.typ := InTyp(tag) - ELSIF (tag >= Sxpro) & (tag <= Scpro) THEN (* Procedure tags *) + ELSIF tag >= Sxpro THEN obj^.conval := NewConst(); obj^.conval^.intval := -1; InSign(mno, obj^.typ, obj^.link); @@ -1081,33 +998,16 @@ 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) - ELSIF (tag = Svar) OR (tag = Srvar) THEN + ELSE 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 *) @@ -1140,8 +1040,6 @@ 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 @@ -1328,75 +1226,45 @@ END Import; END END OutConstant; -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 - (* 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) + 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 END - (* If condition is false, we skip the comment entirely *) END; - - 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; + OutObj(obj^.right) + END + END OutObj; PROCEDURE Export*(VAR ext, new: BOOLEAN); VAR i: INTEGER; nofmod: SHORTINT; done: BOOLEAN; diff --git a/src/compiler/extTools.Mod b/src/compiler/extTools.Mod index c51d8c4d..0c7acded 100644 --- a/src/compiler/extTools.Mod +++ b/src/compiler/extTools.Mod @@ -44,14 +44,12 @@ BEGIN END execute; -PROCEDURE InitialiseCompilerCommand(VAR s: ARRAY OF CHAR; additionalopts: ARRAY OF CHAR); +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); - Strings.Append(additionalopts, s); - Strings.Append(" ", s); Platform.GetEnv("CFLAGS", CFLAGS); Strings.Append (CFLAGS, s); Strings.Append (" ", s); @@ -62,7 +60,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); @@ -74,9 +72,10 @@ PROCEDURE LinkMain*(VAR moduleName: ARRAY OF CHAR; statically: BOOLEAN; addition VAR cmd: CommandString; BEGIN - InitialiseCompilerCommand(cmd, additionalopts); + InitialiseCompilerCommand(cmd); 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); diff --git a/src/library/ooc/oocIntStr.Mod b/src/library/ooc/oocIntStr.Mod index 2b8213ca..ec98f128 100644 --- a/src/library/ooc/oocIntStr.Mod +++ b/src/library/ooc/oocIntStr.Mod @@ -1,49 +1,49 @@ -(* $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 - (** possible values: strAllRight, strOutOfRange, strWrongFormat, strEmpty *) - ConvResults*= Conv.ConvResults; + ConvResults*= Conv.ConvResults; + (* possible values: strAllRight, strOutOfRange, strWrongFormat, strEmpty *) CONST - (** the string format is correct for the corresponding conversion *) strAllRight*=Conv.strAllRight; - (** the string is well-formed but the value cannot be represented *) + (* the string format is correct for the corresponding conversion *) strOutOfRange*=Conv.strOutOfRange; - (** the string is in the wrong format for the conversion *) + (* the string is well-formed but the value cannot be represented *) strWrongFormat*=Conv.strWrongFormat; - (** the given string is empty *) + (* the string is in the wrong format for the conversion *) strEmpty*=Conv.strEmpty; - - -(** 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} *) -(** Ignores any leading spaces in `str'. If the subsequent characters in `str' + +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 @@ -63,10 +63,10 @@ BEGIN END END Reverse; -(** 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); +(* 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 *) VAR @@ -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/library/s3/ethBase64.Mod b/src/library/s3/ethBase64.Mod deleted file mode 100644 index 66bcde05..00000000 --- a/src/library/s3/ethBase64.Mod +++ /dev/null @@ -1,233 +0,0 @@ -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/library/s3/ethStrings.Mod b/src/library/s3/ethStrings.Mod index b2cf4901..49f8a974 100644 --- a/src/library/s3/ethStrings.Mod +++ b/src/library/s3/ethStrings.Mod @@ -7,21 +7,16 @@ MODULE ethStrings; (** portable *) (* ejz, *) Note: All strings MUST be 0X terminated. *) IMPORT Texts, Dates := ethDates, Reals := ethReals; - + CONST - (** the Oberon end of line character *) - CR* = 0DX; - (** the horizontal tab character *) - Tab* = 09X; - (** the UNIX end of line character *) - LF* = 0AX; + CR* = 0DX; (** the Oberon end of line character *) + Tab* = 09X; (** the horizontal tab character *) + LF* = 0AX; (** the UNIX end of line character *) + VAR - (** 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; + 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 *) sDayName: ARRAY 7, 4 OF CHAR; lDayName: ARRAY 7, 12 OF CHAR; sMonthName: ARRAY 12, 4 OF CHAR; @@ -29,7 +24,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; @@ -40,7 +35,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; @@ -55,7 +50,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; @@ -129,7 +124,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; @@ -140,7 +135,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; @@ -151,7 +146,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; @@ -162,7 +157,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; @@ -173,7 +168,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; @@ -184,7 +179,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; @@ -205,7 +200,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; @@ -228,7 +223,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; @@ -250,7 +245,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; @@ -311,7 +306,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; @@ -450,13 +445,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); @@ -578,14 +573,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); @@ -711,7 +706,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 @@ -740,14 +735,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 diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index 64236a7d..aede16c4 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -413,12 +413,6 @@ 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 @@ -679,7 +673,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 diff --git a/src/runtime/Math.Mod b/src/runtime/Math.Mod index 0d1d61f5..b3ca4e6a 100644 --- a/src/runtime/Math.Mod +++ b/src/runtime/Math.Mod @@ -741,32 +741,6 @@ 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 b1448dc0..bd17b490 100644 --- a/src/runtime/MathL.Mod +++ b/src/runtime/MathL.Mod @@ -665,32 +665,6 @@ 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; diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index 8895037c..bdb6b8df 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -1,7 +1,4 @@ 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; @@ -19,11 +16,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; @@ -35,7 +32,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 @@ -49,10 +46,7 @@ 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; @@ -88,7 +82,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; @@ -123,15 +117,14 @@ END Ten; PROCEDURE -Entier64(x: LONGREAL): SYSTEM.INT64 "(INT64)(x)"; -(** RealP(x, n) writes the long real number x to the end of the output stream using an +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 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. 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 *) @@ -219,18 +212,11 @@ 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; @@ -238,10 +224,4 @@ 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/runtime/SYSTEM.c b/src/runtime/SYSTEM.c index 2952bb66..a1b2cb14 100644 --- a/src/runtime/SYSTEM.c +++ b/src/runtime/SYSTEM.c @@ -151,61 +151,53 @@ 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 - void segfaultHandler(int signal) { - __HALT(-10); - } - // Revised signal handler to accommodate additional signals like SIGSEGV + SystemSignalHandler handler[3] = {0}; + + // Provide signal handling for Unix based systems void signalHandler(int s) { - if ((s >= 2 && s <= 4) || s == 11) { // Include SIGSEGV (usually signal 11) - if (handler[s-2]) { - handler[s-2](s); - } - } - // Ignore other signals + if (s >= 2 && s <= 4) handler[s-2](s); + // (Ignore other signals) } void SystemSetHandler(int s, ADDRESS h) { - if ((s >= 2 && s <= 4) || s == 11) { + if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; - if (needtosetsystemhandler) { - signal(s, signalHandler); - } + if (needtosetsystemhandler) {signal(s, signalHandler);} } } - void setupAutomaticSegfaultHandler() { - SystemSetHandler(11, (ADDRESS)segfaultHandler); // Register handler for SIGSEGV - } - #else - // Windows system remains as is since Windows does not use SIGSEGV in the same way + + // Provides Windows callback handlers for signal-like scenarios #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 { + } else { // Close, logoff or shutdown if (SystemQuitHandler) { - SystemQuitHandler(3); // SIGQUIT + SystemQuitHandler(3); // SIGQUIT return TRUE; } } return FALSE; } + void EnsureConsoleCtrlHandler() { if (!ConsoleCtrlHandlerSet) { SetConsoleCtrlHandler(SystemConsoleCtrlHandler, TRUE); @@ -224,4 +216,3 @@ typedef void (*SystemSignalHandler)(INT32); // = Platform_SignalHandler } #endif - diff --git a/src/runtime/SYSTEM.h b/src/runtime/SYSTEM.h index 39d594ed..07c6fd10 100644 --- a/src/runtime/SYSTEM.h +++ b/src/runtime/SYSTEM.h @@ -116,11 +116,9 @@ extern void Modules_AssertFail(INT32 x); // Index checking -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)) +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 @@ -267,12 +265,7 @@ extern void Heap_INCREF(); 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/src/runtime/Texts.Mod b/src/runtime/Texts.Mod index aba83032..5b645fc4 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 *) diff --git a/src/runtime/VT100.Mod b/src/runtime/VT100.Mod index 6687ed02..03cc1d2c 100644 --- a/src/runtime/VT100.Mod +++ b/src/runtime/VT100.Mod @@ -168,15 +168,8 @@ 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 *) diff --git a/src/test/confidence/testenv.sh b/src/test/confidence/testenv.sh index e0a157ee..fdb13cc2 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="-g1 -Wa,-acdhln=new.asm -Wl,-Map=output.map" +then export CFLAGS="-gstabs -g1 -Wa,-acdhln=new.asm -Wl,-Map=output.map" fi diff --git a/src/test/md5/hello.txt b/src/test/md5/hello.txt deleted file mode 100644 index 980a0d5f..00000000 --- a/src/test/md5/hello.txt +++ /dev/null @@ -1 +0,0 @@ -Hello World! diff --git a/src/test/md5/md5test.Mod b/src/test/md5/md5test.Mod deleted file mode 100644 index a6e685fb..00000000 --- a/src/test/md5/md5test.Mod +++ /dev/null @@ -1,55 +0,0 @@ -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: POINTER TO ARRAY OF CHAR; - ilen: LONGINT; - ch: CHAR; - i: INTEGER; -BEGIN - F := Files.Old("hello.txt"); - 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; - 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.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 *) - Out.String("MD5 Hash: "); Out.String(hexDigest); Out.Ln; -END main; - -BEGIN - main; -END md5test. - 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); diff --git a/src/test/texts/argTexts.Mod b/src/test/texts/argTexts.Mod deleted file mode 100644 index 644813d0..00000000 --- a/src/test/texts/argTexts.Mod +++ /dev/null @@ -1,24 +0,0 @@ -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. diff --git a/src/tools/browser/BrowserCmd.Mod b/src/tools/browser/BrowserCmd.Mod index e4ffe88f..14df830f 100644 --- a/src/tools/browser/BrowserCmd.Mod +++ b/src/tools/browser/BrowserCmd.Mod @@ -63,24 +63,6 @@ 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("(** "); - (* 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; CASE obj^.mode OF |OPT.Con: Indent(2); Ws(obj^.name); Ws(" = "); CASE obj^.typ^.form OF diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 258a1b4e..ecfc3f1f 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -113,7 +113,6 @@ 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); @@ -125,22 +124,19 @@ void determineOS() { } #define optimize "" // " -O1" -// FIXME ignoring warning floods that possibly are problems -#define ignore_gcc_warning_flood " -Wno-stringop-overflow -std=gnu11" -#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_warning_flood optimize; + cc = "i686-w64-mingw32-gcc -g" optimize; } else { - cc = "x86_64-w64-mingw32-gcc -g" ignore_gcc_warning_flood optimize; + cc = "x86_64-w64-mingw32-gcc -g" optimize; } #elif defined(__clang__) compiler = "clang"; - cc = "clang -fPIC -g" ignore_clang_warning_flood optimize; + cc = "clang -fPIC -g" optimize; #elif defined(__TINYC__) compiler = "tcc"; cc = "tcc -g"; @@ -149,9 +145,9 @@ void determineCCompiler() { compiler = "gcc"; if (strncasecmp(os, "cygwin", 6) == 0) { // Avoid cygwin specific warning that -fPIC is ignored. - cc = "gcc -g" ignore_gcc_warning_flood optimize; + cc = "gcc -g" optimize; } else { - cc = "gcc -fPIC -g" ignore_gcc_warning_flood optimize; + cc = "gcc -fPIC -g" optimize; } #elif defined(_MSC_VER) compiler = "msc"; diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index d68cc09b..dd1610bb 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 @@ -369,7 +369,6 @@ 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 diff --git a/src/tools/make/sourcechanges.sh b/src/tools/make/sourcechanges.sh index 86aa9542..e20e6841 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") - grep -E -v -f ../../src/tools/make/ignore "$f" >$fn.old - grep -E -v -f ../../src/tools/make/ignore $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 ""